home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Freeware / Programare / highlight / highlight-W32GUI-2.2-10b-Setup.exe / {app} / src / xslfogenerator.h < prev   
C/C++ Source or Header  |  2005-03-20  |  3KB  |  92 lines

  1. /***************************************************************************
  2.                           xslfocode.h  -  description
  3.                              -------------------
  4.     begin                : Do 11.12.2003
  5.     copyright            : (C) 2003 by Andre Simon
  6.     email                : andre.simon1@gmx.de
  7.  ***************************************************************************/
  8.  
  9. /***************************************************************************
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  ***************************************************************************/
  17.  
  18. #ifndef XSLFOGENERATOR_H
  19. #define XSLFOGENERATOR_H
  20.  
  21.  
  22. #include <string>
  23. #include <sstream>
  24. #include <iostream>
  25. #include <fstream>
  26.  
  27. #include "codegenerator.h"
  28. #include "version.h"
  29.  
  30. namespace highlight {
  31.  
  32. /**
  33.    \brief This class generates XSL-FO.
  34.  
  35.    It contains information about the resulting document structure (document
  36.    header and footer), the colour system, white space handling and text
  37.    formatting attributes.
  38.  
  39. * @author Andre Simon
  40. */
  41.  
  42. class XslFoGenerator : public highlight::CodeGenerator
  43.   {
  44.   public:
  45.  
  46.    /** Constructor
  47.      \param colourTheme Name of Colour theme to use
  48.      \param enc encoding name
  49.      \param omitEnc switch to omit encoding information
  50.      \param fopCompatible Test if output should be compatible with Apache FOP 0.20.5
  51.     */
  52.     XslFoGenerator( const string &colourTheme,
  53.                     const string &enc,
  54.                     bool omitEnc=false,
  55.                     bool fopCompatible=false);
  56.  
  57.     XslFoGenerator();
  58.  
  59.     ~XslFoGenerator();
  60.  
  61.    /** prints document header
  62.        \param  title Title of the document
  63.     */
  64.     string getHeader(const string & title);
  65.  
  66.     /** Prints document footer*/
  67.     string getFooter();
  68.  
  69.     /** Prints document body*/
  70.     void printBody();
  71.  
  72.   private:
  73.     ostringstream snl;
  74.  
  75.     string styleDefinition, encoding;
  76.     bool fopOutput, omitEncoding;
  77.  
  78.     /** \return escaped character*/
  79.     virtual string maskCharacter(unsigned char );
  80.  
  81.     string getOpenTag(const ElementStyle &);
  82.  
  83.   //  string getNewLine();
  84.  
  85.     string getMatchingOpenTag(unsigned int styleID);
  86.     string getMatchingCloseTag(unsigned int styleID);
  87.   };
  88.  
  89. }
  90.  
  91. #endif
  92.